set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'wfxr/tmux-fzf-url'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# set -g @plugin "janoamaral/tokyo-night-tmux"
# set -g @plugin 'hasundue/tmux-gruvbox-material'
# set -g @plugin 'wfxr/tmux-power'

set -g status-interval 1
# set -g @tmux_power_theme 'sky'
# set escape-time in ~/.tmux.conf
set-option -sg escape-time 10

set-option -g focus-events on

set -g prefix C-b
bind C-b send-prefix

setw -g mode-keys vi
set -g mouse on

set -g @fzf-url-bind 'x'

# set -g default-terminal "tmux-256color"
# set -ag terminal-overrides ",xterm-256color:RGB"

# set-option -g default-terminal "xterm-256color"
set-option -g default-terminal "screen-256color"
set-option -ga terminal-overrides ',xterm-256color:Tc'

# set-option -g default-shell /bin/zsh

# set -g @gruvbox-material_theme 'dark' # or 'light'
# set -g @gruvbox-material_contrast 'medium' # or 'soft' or 'hard'

# set -g status-bg '#414868'
# set -g status-bg "#1a1b26"

set -g status-right-length 150
set -g status-left-length 100

set -g status-position bottom
set -g status-bg colour235
# set -g status-bg colour249
# set -g status-bg colour110
set -g status-fg colour137
set -g status-left ''
set -g status-right '#[fg=black,bg=colour153]| %d/%m/%y |#[fg=black,bg=colour153] %H:%M:%S |'

# setw -g window-status-current-format ' #I#[fg=colour250]:#[bg=cyan]#W#[fg=colour50]#F '
setw -g window-status-current-format '#[bg=colour110] #[bg=colour110,fg=black]#I#[fg=black,bg=colour110]:#[bg=colour110]#W#[fg=black]#F '
setw -g window-status-format '#[bg=colour248,fg=black] #I#[bg=colour248,fg=black]:#[bg=colour248,fg=black]#W#[bg=colour248,fg=black]#F '

bind-key v split-window -h
bind-key s split-window -v

# bind-key J resize-pane -D 5
# bind-key K resize-pane -U 5
# bind-key H resize-pane -L 5
# bind-key L resize-pane -R 5

# bind-key M-j resize-pane -D
# bind-key M-k resize-pane -U
# bind-key M-h resize-pane -L
# bind-key M-l resize-pane -R

# Vim style pane selection
# bind h select-pane -L
# bind j select-pane -D
# bind k select-pane -U
# bind l select-pane -R

# Use Alt-vim keys without prefix key to switch panes
# bind -n M-h select-pane -L
# bind -n M-j select-pane -D
# bind -n M-k select-pane -U
# bind -n M-l select-pane -R

# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D

# Shift arrow to switch windows
bind -n S-Left  previous-window
bind -n S-Right next-window

bind P paste-buffer

bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'r' send -X rectangle-toggle
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel

run '~/.tmux/plugins/tpm/tpm'

# Useful
# tmux -f $XDG_CONFIG_HOME/tmux.conf
